/*
 * GoodsDetailContract.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.goodsdetail;

import com.yidiandao.business.base.BasePresenter;
import com.yidiandao.business.base.BaseView;
import com.yidiandao.business.data.bean.ShareEntity;
import com.yidiandao.business.data.response.GoodsDetailResponse;

/** 商品详情契约类. */
public class GoodsDetailContract {

    public interface Presenter extends BasePresenter {

        void getGoodsDetail(String goodsId);

        void collectGoods(String goodsId, boolean hasCollect);

        void addToCart(String goodsId, int count);

        void buyNow(String goodsId, int count);

        ShareEntity getShareEntity();

        void postRefreshHomeSecondKillEvent();
    }

    interface View extends BaseView<Presenter> {

        void setViewGone(); //非加载成功时隐藏头部和底部

        void setViewVisible();

        void showDialog();

        void dismissDialog();

        String getGoodsId();

        void toConfirmOrderActivity(String json);

        /** @param num 加入购物车的数量 */
        void setCartStyle(int num);

        /** @param hasCollect 是否已收藏 */
        void setCollectStyle(boolean hasCollect);

        void setGoodsInfo(GoodsDetailResponse.DataBean dataBean);

        void setViewPager(GoodsDetailResponse.DataBean dataBean);

        void setCanBuyStatus(boolean canBuy);

        boolean canCart();
    }
}
